//
//  SingerListTableViewCell.m
//  MMLOOK
//
//  Created by BraveMatch on 15/10/6.
//  Copyright (c) 2015年 武俊娥. All rights reserved.
//

#import "SingerListTableViewCell.h"
#import "MyMusicModel.h"
#import "UIImageView+WebCache.h"
#define OffWidth [UIScreen mainScreen].bounds.size.width / 375
#define OffHeight [UIScreen mainScreen].bounds.size.height / 667
@interface SingerListTableViewCell ()
@property (nonatomic, retain) UIImageView *showImage;
@property (nonatomic, retain) UILabel *singerNameLabel;

@end

@implementation SingerListTableViewCell
- (void)dealloc
{
    [_showImage release];
    [_singerNameLabel release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.showImage = [[UIImageView alloc] initWithFrame:CGRectMake(45, 5, 60*OffWidth, 60*OffHeight)];
        self.showImage.clipsToBounds = YES;
        self.showImage.layer.cornerRadius = 10;
        [self.contentView addSubview:_showImage];
        [_showImage release];
        
        self.singerNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_showImage.frame.origin.x + _showImage.frame.size.width + 30,15, 120*OffWidth, 40*OffHeight)];
        self.singerNameLabel.backgroundColor = [UIColor clearColor];
        self.singerNameLabel.textColor = [UIColor blackColor];
        [self.contentView addSubview:self.singerNameLabel];
        [_singerNameLabel release];
        

    }
    return self;
}


-(void)setValueWith:(MyMusicModel *)model
{
    [self.showImage sd_setImageWithURL:[NSURL URLWithString:model.pic_url] placeholderImage:nil];
    self.singerNameLabel.text = model.singer_name;

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
